<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$is_language?'交易大廳':'Trading hall'}</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/weui.min.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/jquery-weui.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/demos.css">
    <script src="__MODULE_LIBS__/js/jquery-2.1.4.js"></script>
    <!--<script src="__MODULE_LIBS__/js/fastclick.js"></script>-->
    <script src="__MODULE_LIBS__/js/jquery-weui.js"></script>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        html {
            width: 100%;
            height: 100%;
            font-size: 20px;
            font-family: "Microsoft YaHei", "宋体", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
            background: #F3F3F3;
        }

        body {
            margin: 0 auto;
            max-width: 750px;
            height: 100%;
            background: #F7F7F7;
        }

        input[type="button"], input[type="submit"], input[type="reset"],
        input[type="number"], input[type="datetime-local"] {
            -webkit-appearance: none !important;
        }

        textarea {
            -webkit-appearance: none;
        }

        li {
            list-style: none;
        }

        /*顶部导航栏处的样式*/
        .navbar {
            position: relative;
            width: 100%;
            height: 2rem;
            font-size: 16px;
            color: #fff;
            line-height: 2rem;
            background: #373553;
        }

        .navbar-item {
            position: absolute;
            left: 0;
            top: 0;
            display: block;
            width: 5.0rem;
            height: 2rem;
            font-size: 14px;
            color: #fff;
            text-align: center;
        }

        .navbar-item > img {
            width: 0.8rem;
            height: 0.7rem;
            vertical-align: middle;
        }

        .navbar-center {
            text-align: center;
        }

        .navbar-center > img {
            width: 1.2rem;
            vertical-align: middle;
            margin-top: -0.2rem;
            margin-left: 0.4rem;
            margin-right: 0.1rem;
        }

        .header {
            position: relative;
            width: 100%;
            height: 8.0rem;
            /*background: url(__MODULE_LIBS__/img/headerbg.png) center center no-repeat;*/
            background: #000000;
            background-size: 100% 100%;
            display: flex;
            flex-direction: column;
            /*justify-content: space-between;*/
            align-items: center;
        }

        .chattit {
            /*padding-top: 1.6rem;*/
            font-size: 0.70rem;
            /*text-align: center;*/
            color: #ffffff;
            width: 85%;
            display: flex;
            flex-direction: column;
            /*align-items: center;*/
            justify-content: center;
        }

        .headlist {
            position: absolute;
            bottom: -38px;
            /*left: 2%;*/
            width: 96%;
            /*height: 2.95rem;*/
            font-size: 0.6rem;
            display: flex;
            justify-content: space-around;
            background-color: #fff;
            border-radius: .8rem;
        }

        .headlist > li {
            position: relative;
            float: left;
            /*width: 20%;*/
            padding: 1rem 0;
            text-align: center;
            line-height: 1.6;
        }

        .headlist > li:first-child {
            border-radius: 0.25rem 0 0 0;
        }

        .headlist > li:last-child {
            border-radius: 0 0.25rem 0 0;
        }

        .headlist > li > a {
            display: inline-block;
            width: 100%;
            height: 100%;
            color: #8E8E8E;
            font-size: 12px;
        }

        .nr {
            display: inline-block;
            font-size: 16px;
            /*width: 90%;*/
            line-height: 1;
            word-break: keep-all; /* 不换行 */
            white-space: nowrap; /* 不换行 */
            overflow: hidden; /* 内容超出宽度时隐藏超出部分的内容 */
            text-overflow: ellipsis; /* 当对象内文本溢出时显示省略标记(...) */
            color: #713EA5;
        }

        .line {
            position: absolute;
            bottom: 0.8rem;
            width: 1px;
            height: 28px;
            background: #c7c7cc;
        }

        .line1 {
            left: 20%;
        }

        .line2 {
            left: 40%;
        }

        .line3 {
            left: 60%;
        }

        .line4 {
            left: 80%;
        }

        /*主体部分的样式*/
        .content {
            width: 96%;
            margin: 0 auto;
            margin-top: 50px;
        }

        /*发行資產处的样式*/
        .issue {
            height: 1.6rem;
            color: #F44444;
        }

        /*列表样式*/
        .weui-cells {
            margin-top: 0;
            font-size: 0.7rem;
        }

        .weui-cell {
            padding: 0.5rem 0.5rem;
            background-color: #fff;
            /*margin-bottom: 10px;*/
        }

        .weui-cell__hd {
            width: 3.4rem;
            height: 100%;
        }

        .product {
            display: inline-block;
            width: 100%;
            height: 100%;
            color: #333;
            word-wrap: break-word;
            font-weight: bold;
        }

        .price {
            margin-bottom: 0.5rem;
            font-size: 0.75rem;
            font-weight: bold;
            color: #F44444;
        }

        .apply {
            position: relative;
            display: inline-block;
            margin-top: 0.4rem;
            padding: 0.1rem 0.2rem;
            font-size: 0.6rem;
            color: #F44444;
            border: 1px #F44444 solid;
            border-radius: 4px;
        }

        .buytit {
            position: absolute;
            right: 0rem;
            top: -0.2rem;
            padding: 2px 2px 1px 2px;
            font-size: 0.5rem;
            line-height: 0.9;
        }

        .selltit {
            position: absolute;
            right: 0rem;
            top: -0.2rem;
            padding: 2px 2px 1px 2px;
            font-size: 0.5rem;
            line-height: 0.9;
        }

        .weui-btn + .weui-btn {
            margin-top: 0.3rem;
        }

        .weui-btn_mini {
            padding: 0 0.6rem;
        }

        .weui-media-box__desc {
            vertical-align: bottom;
            font-size: 0.5rem;
        }

        .timer {
            color: #f44444;
        }

        .picture {
            background-color: #713EA5;
        }

        .modify {
            background-color: #999999;
        }

        .footerlink {
            margin-top: 1rem;
            width: 100%;
            max-width: 750px;
            height: 2.4rem;
            margin-bottom: 0.5rem;
        }

        .footerlink > p {
            width: 100%;
            height: 1.2rem;
            text-align: center;
            color: #777777;
            font-size: 0.65rem;
            line-height: 1.2rem;
        }

        .footerlink a {
            display: inline-block;
            /*width: 6.4rem;*/
            height: 100%;
            color: #777777;
            text-align: center;
        }

        .issue-dlog, .modify-dlog, .buy-dlog, .select-dlog {
            position: fixed;
            top: 0px;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            z-index: 10000;
            display: none;
        }

        .dlog {
            position: relative;
            top: 5rem;
            left: 0;
            margin: 0 auto;
            padding: 0.5rem;
            width: 14.5rem;
            height: auto;
            background: #fff;
            border-radius: 0.4rem;
            z-index: 100000;
        }

        .issue-close, .modify-close, .buy-close {
            position: absolute;
            top: 0rem;
            right: 0rem;
            width: 2rem;
            height: 1.4rem;
            text-align: center;
            line-height: 1.4rem;
            cursor: pointer;
        }

        .issueForm, .modifyForm, .buyForm {
            margin-top: 0.5rem;
            width: 100%;
            font-size: 0.65rem;
        }

        .issueForm > p, .modifyForm > p, .buyForm > p {
            display: block;
            width: 100%;
            height: 1.6rem;
            line-height: 1.6rem;
            margin-top: 0.4rem;
            margin-bottom: 0.3rem;
            text-align: center;
        }

        .issueForm > .visi, .modifyForm > .visi {
            margin-left: 0.25rem;
            text-align: left;
        }

        .issueForm input[type="text"],
        .modifyForm input[type="text"],
        .buyForm input[type="number"],
        .issueForm input[type="datetime"],
        .issueForm input[type="datetime-local"],
        .modifyForm input[type="datetime-local"] {
            padding-left: 0.3rem;
            width: 8.5rem;
            height: 1.4rem;
            border: 0;
            border-bottom: 1px #F44444 solid;
            outline: 0;
        }

        .issuebtn, .modifybtn, .buybtn , .buybtn1{
            width: 5rem;
            height: 1.5rem;
            color: #FFFFFF;
            background: #713EA5;
            border: 0;
            border-radius: 0.2rem;
            outline: 0;
            cursor: pointer;
            margin: 0 .5rem;
        }
        .issuebtn, .modifybtn, .rongzi,.issuebtn_2 {
            width: 5rem;
            height: 1.5rem;
            color: #FFFFFF;
            background: #713EA5;
            border: 0;
            border-radius: 0.2rem;
            outline: 0;
            cursor: pointer;
            margin: 0 .5rem;
        }

        .weui-mask {
            z-index: 1000000;
        }

        .weui-dialog {
            z-index: 2000000;
        }

        .weui-picker-overlay, .weui-picker-container {
            z-index: 2000000;
        }
        .bottom:before {
            border: none;
        }
        .weui-grid:before {
            border: none;
        }
        .weui-grid:after {
            border: none;
        }
        .no_b:before {
            border: none;
        }
        .weui-grid {
            padding: 4px 2px;
        }
        .weui-grid__icon {
            font-size: 16px;
        }
        .weui-cell__ft p {
            margin-bottom: 4px;
        }
        .weui-grid__icon+.weui-grid__label {
            margin-top: 0;
        }
        .weui-grid__label {
            color: #8E8E8E;
        }
        .bg-pur {
            background-color: #373553;
        }
        #yy {
            border-radius: 15px;
            font-size: 12px;
            padding: 4px 10px;
            width: auto!important;
            height: auto!important;
        }
        .navbar-item1 {
            display: flex;
            align-items: center;
        }
        .weui-btn {
            border-radius: 15px;
        }
        .buy {
            background-color: #fff;
            border: 1px solid #713EA5;
            color: #713EA5;
            border-width: 1px!important;
        }
        .weui-grids::after {
            border: none;
        }
    </style>
</head>
<body>
<header class="navbar bg-pur">
    <a href="{:url('index/index')}" class="navbar-item">
        <img src="__MODULE_LIBS__/img/back.png"/>&nbsp;{$is_language?'個人中心':'Personal Center'}
    </a>
    <div class="navbar-center"><img src="__MODULE_LIBS__/img/alading.png"/>{$is_language?'HGB':'HGB'}</div>
    <div class="navbar-item1">
        <select name="" id="yy">
            <option value="1" {$is_language?
            'selected':''}>中文</option>
            <option value="0" {$is_language?
            '':'selected'}>English</option>
        </select>
    </div>
</header>
<!-- 顶部start -->
<div class="header bg-pur">
    <div style="display: flex;justify-content: space-between;align-items:center;width: 96%;margin-top: 1.5rem;">
        {if $user_data['shop_money']}
        <div class="chattit">
            <p style="color:#BBBBBB;font-size: 15px">{$is_language?'昨日交易額':'yesterday money'}</p>
            <p style="font-size: 20px">${$user_data['shop_money']}</p>
        </div>
        {/if}
        {if $_SESSION['dolphin_admin_']['home_user']['group_id']==2}
        {if $_SESSION['dolphin_admin_']['home_password']==1}
        <div class="issue chattit">
            <p style="font-size: 20px;text-align: end;color: #fff;">{$is_language?'發行資產':'Issue assets'}+</p>
        </div>
        {/if}
        {/if}
    </div>
    <ul class="headlist">
        <li><a href="javascript:;"><span class="nr">{$user_data['sum_money']}</span><br/>{$is_language?'HGB總值':'HGB gross value'}</a></li>
        <li><a href="javascript:;"><span class="nr">{$user_data['money1']}</span><br/>{$is_language?'積分':'integral'}</a></li>
        {if $_SESSION['dolphin_admin_']['home_user']['group_id']==2}
        <li><a href="javascript:;"><span class="nr">{$user_data['money4']}</span><br/>{$is_language?'資產余额':'assets balance'}</a></li>
        {/if}
        <li><a href="javascript:;"><span class="nr">{$user_data['money2']}</span><br/>{$is_language?'獎金':'Bonus'}</a></li>
        <li><a href="javascript:;"><span class="nr">{$user_data['code']}</span><br/>{$is_language?'邀請碼':'Invitationcode'}</a></li>

    </ul>
    <!--<div class="line line1"></div>-->
    <!--<div class="line line2"></div>-->
    <!--<div class="line line3"></div>-->
    <!--<div class="line line4"></div>-->
</div>
<!-- /顶部end -->
<div class="content">
    <div style="font-size: 15px;color: #8E8E8E;margin: 10px;">{$is_language?'交易中心':'Trading Center'}</div>
    <div class="weui-cells" style="background-color: inherit">
        {foreach $goods as $vo}
        <div class="weui-cell bottom">
            <input type="hidden" name="id" value="{$vo.id}" class="hiddenid">
            <div class="weui-cell__hd">
                <a href="javascript:;" class="product">{$vo.name}</a>
            </div>
            <div class="weui-cell__bd">
                <p class="price">{$is_language?'當前價格':'Current price'}:${$vo.money}</p>
                <p class="weui-media-box__desc">{$is_language?'發行價格':'Issue price'}:${$vo.int_money}</p>
                {if $_SESSION['dolphin_admin_']['home_user']['group_id']==2}
                {if $_SESSION['dolphin_admin_']['home_user']['id']==$vo.user_id}
                <p>
                    <a class="apply buyin" href="{:url('buyin',['id'=>$vo['id']])}">
                        {$is_language?'買入申請':'Buy application'}
                        {if @$vo.purchase_count}
                        <span class="weui-badge buytit">{$vo.purchase_count}</span>
                        {/if}
                    </a>

                    <a class="apply sellout" href="{:url('sell',['id'=>$vo['id']])}">
                        {$is_language?'賣出申請':'Sell request'}
                        {if @$vo.sell_count}
                        <span class="weui-badge selltit">{$vo.sell_count}</span>
                        {/if}
                    </a>
                </p>

                <!--<p>-->
                    <!--<a class="apply buyin" href="{:url('buyin',['id'=>$vo['id'],'buy_type'=>2])}">-->
                        <!--{$is_language?'做空申請':'Short for'}-->
                        <!--{if @$vo.zk_purchase_count}-->
                        <!--<span class="weui-badge buytit">{$vo.zk_purchase_count}</span>-->
                        <!--{/if}-->
                    <!--</a>-->

                    <!--<a class="apply sellout" href="{:url('sell',['id'=>$vo['id'],'buy_type'=>2])}">-->
                        <!--{$is_language?'平倉申請':'Unwinding application'}-->
                        <!--{if @$vo.zk_sell_count}-->
                        <!--<span class="weui-badge selltit">{$vo.zk_sell_count}</span>-->
                        <!--{/if}-->
                    <!--</a>-->
                <!--</p>-->
                {/if}
                {/if}
            </div>
            <div class="weui-cell__ft">
                <p class="weui-media-box__desc" style="color:#BBBBBB">{$vo.create_time|date="Y-m-d H:i",###}</p>
                {if strtotime($vo['endTime'])>time()}
                <p class="weui-media-box__desc" style="color:#BBBBBB">{$is_language?'開盤時間':'Opening time'}:{$vo.endTime}</p>
                {/if}
                <p class="weui-media-box__desc timer" endTime="{$vo.endTime}"></p>
                {if $_SESSION['dolphin_admin_']['home_user']['group_id']==2}
                {if $_SESSION['dolphin_admin_']['home_user']['id']==$vo.user_id}
                {if $vo.is_examine==0}
                <p style="font-size: 0.6rem;"> {$is_language?'等待後臺審核':'Waiting for background audit'}</p>
                {else}
                <button type="button" class="weui-btn weui-btn_mini modify">{$is_language?'修改':'modify'}</button>
                {/if}
                {/if}
                {/if}
                <a href="{:url('main',['id'=>$vo.id])}">
                    <button type="button" class="weui-btn weui-btn_mini picture" style="width: 5.4rem;margin-bottom: .2rem">{$is_language?'走势图':'Trend chart'}
                    </button>
                </a>
                {if $_SESSION['dolphin_admin_']['home_user']['group_id']!=2}
                <p>
                    <button type="button" class="weui-btn weui-btn_mini weui-btn_warn buy" style="width: 5.4rem;">{$is_language?'買入':'Buy'}
                    </button>
                    <!--<button type="button" class="weui-btn weui-btn_mini weui-btn_warn buy_k" style="width: 2.5rem;">{$is_language?'做空':'Empty'}-->
                    <!--</button>-->
                </p>
                {/if}

                {if $vo['shop_money']>0}
                <p>{$is_language?'昨日交易金額：':"Amount of yesterday's transaction:"}${$vo['shop_money']}</p>
                {/if}
            </div>
        </div>

        {if $_SESSION['dolphin_admin_']['home_user']['group_id']==2}
        <div class="weui-grids" style="background: #fff">
            <div style="text-align: center;font-weight: bold">{$is_language?'購買統計':'Buy up statistics'}：</div>
            <div href="" class="weui-grid js_grid" style="color: #F44444;">
                <div class="weui-grid__icon">
                    {$vo['total_money']?$vo['total_money']:'0.00'}
                </div>
                <p class="weui-grid__label" style="color: #F44444;">
                    {$is_language?'當前持有總成本':'Total purchase price'}
                </p>
            </div>

            <div href="" class="weui-grid js_grid" style="color: #F44444;">
                <div class="weui-grid__icon">
                    {$vo['total_new_money']?$vo['total_new_money']:'0.00'}
                </div>
                <p class="weui-grid__label" style="color: #F44444;">
                    {$is_language?'當前持有總價值':'Current total selling price'}
                </p>
            </div>

            <div href="" class="weui-grid js_grid">
                <div class="weui-grid__icon">
                    {$vo['total_profit_loss']?$vo['total_profit_loss']:'0.00'}
                </div>
                <p class="weui-grid__label">
                    {$is_language?'已實際盈虧':'Current total profit and loss'}
                </p>
            </div>
        </div>

        <div class="weui-grids no_b" style="background: #fff;margin-bottom: 15px">
            <div href="" class="weui-grid js_grid" style="width: 25%;">
                <div class="weui-grid__icon">
                    {$vo['total_sum']?$vo['total_sum']:0}
                </div>
                <p class="weui-grid__label" style="font-size: 10px">
                    {$is_language?'當前持有總數量':'Total purchases'}
                </p>
            </div>

            <div href="" class="weui-grid js_grid" style="width: 25%;">
                <div class="weui-grid__icon">
                    {$vo['total_user_num']?$vo['total_user_num']:0}
                </div>
                <p class="weui-grid__label" style="font-size: 10px">
                    {$is_language?'當前持有總人數':'The number of purchases'}
                </p>
            </div>

            <div href="" class="weui-grid js_grid" style="width: 25%;">
                <div class="weui-grid__icon">
                    {$vo['total_sell_num']?$vo['total_sell_num']:'0'}
                </div>
                <p class="weui-grid__label" style="font-size: 10px">
                    {$is_language?'當前已賣出總數量':'Current total sold quantity'}
                </p>
            </div>

            <div href="" class="weui-grid js_grid" style="width: 25%;">
                <div class="weui-grid__icon">
                    {$vo['total_pre_sell_num']?$vo['total_pre_sell_num']:'0'}
                </div>
                <p class="weui-grid__label" style="font-size: 10px">
                    {$is_language?'當前預賣出總數量':'Current pre-sales total'}
                </p>
            </div>
        </div>
        <!--<div class="weui-grids" style="padding-top: 10px;">-->
            <!--<div style="text-align: center;font-weight: bold">{$is_language?'做空統計':'Short statistical'}：</div>-->
            <!--<div href="" class="weui-grid js_grid" style="color: #F44444;">-->
                <!--<div class="weui-grid__icon">-->
                    <!--{$vo['zk_total_money']?$vo['zk_total_money']:'0.00'}-->
                <!--</div>-->
                <!--<p class="weui-grid__label" style="color: #F44444;">-->
                    <!--{$is_language?'當前做空總成本':'Total purchase price'}-->
                <!--</p>-->
            <!--</div>-->

            <!--<div href="" class="weui-grid js_grid" style="color: #F44444;">-->
                <!--<div class="weui-grid__icon">-->
                    <!--{$vo['zk_total_new_money']?$vo['zk_total_new_money']:'0.00'}-->
                <!--</div>-->
                <!--<p class="weui-grid__label" style="color: #F44444;">-->
                    <!--{$is_language?'當前做空總價值':'Current total selling price'}-->
                <!--</p>-->
            <!--</div>-->

            <!--<div href="" class="weui-grid js_grid">-->
                <!--<div class="weui-grid__icon">-->
                    <!--{$vo['zk_total_profit_loss']?$vo['zk_total_profit_loss']:'0.00'}-->
                <!--</div>-->
                <!--<p class="weui-grid__label">-->
                    <!--{$is_language?'已實際盈虧':'Current total profit and loss'}-->
                <!--</p>-->
            <!--</div>-->
        <!--</div>-->

        <!--<div class="weui-grids no_b" style="border-bottom: 5px solid #DEDFE0;padding-bottom: 10px;">-->
            <!--<div href="" class="weui-grid js_grid" style="width: 25%;">-->
                <!--<div class="weui-grid__icon">-->
                    <!--{$vo['zk_total_sum']?$vo['zk_total_sum']:0}-->
                <!--</div>-->
                <!--<p class="weui-grid__label" style="font-size: 10px">-->
                    <!--{$is_language?'當前做空總數量':'Total purchases'}-->
                <!--</p>-->
            <!--</div>-->

            <!--<div href="" class="weui-grid js_grid" style="width: 25%;">-->
                <!--<div class="weui-grid__icon">-->
                    <!--{$vo['zk_total_user_num']?$vo['zk_total_user_num']:0}-->
                <!--</div>-->
                <!--<p class="weui-grid__label" style="font-size: 10px">-->
                    <!--{$is_language?'當前做空總人數':'The number of purchases'}-->
                <!--</p>-->
            <!--</div>-->

            <!--<div href="" class="weui-grid js_grid" style="width: 25%;">-->
                <!--<div class="weui-grid__icon">-->
                    <!--{$vo['zk_total_sell_num']?$vo['zk_total_sell_num']:'0'}-->
                <!--</div>-->
                <!--<p class="weui-grid__label" style="font-size: 10px">-->
                    <!--{$is_language?'當前已平倉總數量':'Current total sold quantity'}-->
                <!--</p>-->
            <!--</div>-->

            <!--<div href="" class="weui-grid js_grid" style="width: 25%;">-->
                <!--<div class="weui-grid__icon">-->
                    <!--{$vo['zk_total_pre_sell_num']?$vo['zk_total_pre_sell_num']:'0'}-->
                <!--</div>-->
                <!--<p class="weui-grid__label" style="font-size: 10px">-->
                    <!--{$is_language?'當前預平倉總數量':'Current pre-sales total'}-->
                <!--</p>-->
            <!--</div>-->
        <!--</div>-->
        {/if}
        {/foreach}
    </div>
</div>
<input type="hidden" name="yuyan" value="<?php echo @$is_language?>" id="yuyan">
<!--底部链接开始-->
<div class="footerlink">
    <p class="copyright">&copy;{$is_language?'HGB':'HGB'}</p>
    <p>{$is_language?'友情鏈接':'Links'}:<a href="https://www.okcoin.cn/market-btc.html">{$is_language?'國際比特幣交易中心':'International
        bitcoin Trading Center'}</a></p>
</div>
<!--底部链接结束-->

<!--发行資產的弹出框开始-->
<div class="issue-dlog">
    <div class="dlog">
        <div class="issue-close">X</div>
        <form action="{:url('add')}" method="post" class="issueForm">
            <p>
                <label>
                    <span style="color: #F44444;">*</span>{$is_language?'資產名稱':'Asset name'}：
                </label>
                <input type="text" name="name" value=""/>
            </p>
            <p>
                <label>
                    <span style="color: #F44444;">*</span>{$is_language?'初始價格':'Initial price'}：
                </label>
                <input type="text" name="int_money" value="" style="width:7.5rem"/>
            </p>
            <p>
                <label>
                    <span style="color: #F44444;">*</span>{$is_language?'價格區間':'Price range'}：
                </label>
                <input type="text" name="section" value=""/>
            </p>
            <p>
                <label style="margin-left: 0.3rem;">{$is_language?'開盤時間':'Opening time'}：</label>
                <input type="text" id='datetime-picker' name="endTime"/>
            </p>
            <p class="visi">
                {if @$is_language}
                <label style="margin-left: 0.8rem;">是否隱藏：</label>
                {else}
                <label style="margin-left: 0.3rem;">Hidden?：</label>
                {/if}
                <input type="radio" name="status" value="1" checked/>{$is_language?'否':'no?'}
                <input type="radio" name="status" value="0"/>{$is_language?'是':'yes?'}
            </p>
            <p>
                <input type="button" class="issuebtn" value="{$is_language?'發行資產':'Issue assets?'}"/>
            </p>
        </form>
    </div>
</div>
<!--发行資產的弹出框结束-->

<!--购买/融资选择弹出框开始-->
<div class="select-dlog">
    <div class="dlog">
        <div class="buy-close">X</div>
        <p>
            <input type="button" class="buybtn1" value="{$is_language?'全資購買':'A wholly-owned purchase'}"/>
            <!--<input type="button" class="rongzi" value="{$is_language?'申請融資':'Apply for financing'}"/>-->
        </p>
        </form>
    </div>
</div>
<!--购买資產的弹出框结束-->

<!--购买資產的弹出框开始-->
<div class="buy-dlog">
    <div class="dlog">
        <div class="buy-close">X</div>
        <form action="{:url('goods/order')}" method="post" class="buyForm">
            <input type="hidden" value="" name="id" class="buyid">
            <p style="text-align: left;margin-left: 0.8rem;">
                <label>{$is_language?'數量':'Number'}：</label>
                <input type="number" class="numInput" name="sum" value="1">
            </p>
            <div style="margin-left: 0.8rem;">
                <span>{$is_language?'注：您需支付手續費':'Note: you have to pay the handling fee'}$<span id="shouxu"></span>，{$is_language?'總支付':'Total'}$<span
                        id="zong"></span>。</span>
            </div>
            <!--<label for="1" style="margin-left: .8rem">{$is_language?'買漲':'Buy up'}<input type="radio" name="buy_type" id="1" value="1" ></label>-->
            <!--<label for="2">{$is_language?'做空':'Short'}<input type="radio" name="buy_type" id="2" value="2"></label>-->
            <p>
                <input type="button" class="buybtn" value="{$is_language?'確定':'Determine'}"/>
            </p>
        </form>
    </div>
</div>
<!--购买資產的弹出框结束-->

<!--修改資產的弹出框开始-->
<div class="modify-dlog">
    <div class="dlog">
        <div class="modify-close">X</div>
        <form action="{:url('edit')}" method="post" class="modifyForm">
            <input type="hidden" name="id" value="" class="modifyid">
            <p>
                <label>
                    <span style="color: #F44444;">*</span>{$is_language?'價格區間':'Price range'}：
                </label>
                <input type="text" name="section" value="" class="propriarea"/>
            </p>
            <p class="visi">
                <labe style="margin-left: 0.5rem;">
                    <span style="color: #F44444;">*</span>{$is_language?'是否隱藏':'Hidden?'}：
                </labe>
                <input type="radio" name="status" value="1" class="no states"/>{$is_language?'否':'no'}
                <input type="radio" name="status" value="0" class="yes states"/>{$is_language?'是':'yes'}
            </p>
            <p>
                <input type="submit" class="modifybtn" value="{$is_language?'修改':'modify'}"/>
            </p>
        </form>
    </div>
</div>
<!--修改資產的弹出框结束-->


<script type="text/javascript">
    $(document).on("change", 'select#yy', function () {
        var yy = $(this).val();
        console.log(yy)
        var url = "{:url('index/language')}";
        $.post(url, {language: yy}, function (res) {
            window.location.reload();
        })
    });

    //倒计时函数
    function updateEndTime(yuyan) {
        var date = new Date();
        var time = date.getTime(); //当前时间距1970年1月1日之间的毫秒数

        $(".timer").each(function (i) {
            var endDate = this.getAttribute("endTime"); //结束时间字符串
            //转换为时间日期类型
            var endDate1 = eval('new Date(' + endDate.replace(/\d+(?=-[^-]+$)/, function (a) {
                return parseInt(a, 10) - 1;
            }).match(/\d+/g) + ')');
            var endTime = endDate1.getTime(); //结束时间毫秒数
            var lag = (endTime - time) / 1000; //当前时间和结束时间之间的秒数
            if (lag > 0) {
                var second = Math.floor(lag % 60);
                var minite = Math.floor((lag / 60) % 60);
                var hour = Math.floor((lag / 3600) % 24);
                var day = Math.floor((lag / 3600) / 24);

                second = checkTime(second);
                minite = checkTime(minite);
                hour = checkTime(hour);
                day = checkTime(day);

                //将0-9的数字前面加上0，例1变为01
                function checkTime(i) {
                    if (i < 10) {
                        i = "0" + i;
                    }
                    return i;
                }

                if (yuyan == "1") {
                    $(this).html("開盤倒計時:" + day + "天" + hour + "小時" + minite + "分" + second + "秒");
                } else if (yuyan == "0") {
                    $(this).html("Opening countdown:" + day + "day" + hour + "hour" + minite + "minute" + second + "second");
                } else {
                }

            }
            else {
                $(this).removeClass("settime");
                $(this).html("");
            }
        });
        setTimeout("updateEndTime()", 1000);
    }

    $(function () {
//        FastClick.attach(document.body);
        //倒计时调用
        var yuyan = $("#yuyan").val();
        updateEndTime(yuyan);

        //发行資產的弹出框
        $(".issue").click(function () {
            $(".issue-dlog").css('display', 'block');
            $('body').css({
                "overflow-x": "hidden",
                "overflow-y": "hidden"
            });
            //阻止默认
            $("body").on("touchmove", function (event) {
                event.preventDefault;
            }, false);
        });

        $('.issue-close').click(function () {
            $(".issue-dlog").css('display', 'none');
            $('body').css({
                "overflow-x": "auto",
                "overflow-y": "auto"
            });
            //然后点击取消或者确定时再取消body上的绑定
            $("body").off("touchmove");
        });

        $("#datetime-picker").datetimePicker({
            times: function () {
                return [
                    {
                        values: (function () {
                            var hours = [];
                            for (var i = 0; i < 24; i++) hours.push(i > 9 ? i : '0' + i);
                            return hours;
                        })()
                    },
                    {
                        divider: true,  // 这是一个分隔符
                        content: ':00'
                    }
                ];
            },
            onChange: function (picker, values, displayValues) {
//                console.log(values);
            },
        });

        $(".buy_k").click(function () {
            var hidid = $(this).parents(".weui-cell").find('.hiddenid').val();
            $(".buyid").val(hidid);
            $(".buy-dlog").css('display', 'block');
            $('body').css({
                "overflow-x": "hidden",
                "overflow-y": "hidden"
            });
            $("body").on("touchmove", function (event) {
                event.preventDefault;
            }, false);
            $.ajax({
                type: "POST",
                url: "{:url('ajax_data')}",
                dataType: "json",
                data: {
                    id: hidid
                },
                success: function (data) {
                    var shouxu = data.content.con.purchase_fee;
                    var danjia = data.content.goods.money;
                    var zong = parseInt(danjia * shouxu) + parseInt(danjia);
                    var c_s = danjia * shouxu;
                    var c_s = c_s.toFixed(2);
                    var zong = Number(c_s) + Number(danjia);
                    var zong = zong.toFixed(2);
                    $('#shouxu').html(c_s);
                    $('#zong').html(zong);
                    $('.numInput').bind('input propertychange', function () {
                        var shouxu = data.content.con.purchase_fee;
                        var danjia = data.content.goods.money;
                        var num = $('.numInput').val();
                        var yx = shouxu * danjia * num;
                        var yx = yx.toFixed(2);
                        var z_shouxu = parseInt(shouxu * danjia * num).toFixed(2);
                        var zong = Number(yx) + Number(danjia * num);
                        var z_zong = Number(zong).toFixed(2);
                        $('#shouxu').html(yx);
                        $('#zong').html(z_zong);
                    });
                }
            })
            $(".buybtn").click(function (e) {
                if ($('.numInput').val() < 1) {
                    e.preventDefault();
                    var yuyan = $("#yuyan").val();
                    if (yuyan == 1) {
                        $.alert("輸入的數量不能小於1!");
                    } else {
                        $.alert("The number of inputs should not be less than 1!");
                    }
                } else {
                    var yuyan = $('#yuyan').val();
                    if (yuyan == 1) {
                        $.confirm({
                            title: '提示',
                            text: '確定做空嗎？',
                            onOK: function () {
                                //点击确认
                                $.showLoading("做空處理中");
                                $.ajax({
                                    type: "POST",
                                    url: "{:url('goods/order')}",
                                    dataType: "json",
                                    data: {
                                        id: $(".buyid").val(),
                                        sum: $('.numInput').val(),
                                        buy_type: 2
                                    },
                                    success: function (data) {
                                        $.hideLoading();
                                        $.alert(data.msg + "<br/>" + data.msg1, function () {
                                            location.href = "{:url('index/index')}";
                                        });
                                    }
                                })
                            }
                        });
                    } else {
                        $.confirm({
                            title: 'Prompt',
                            text: 'Are you sure of empty?',
                            onOK: function () {
                                //点击确认
                                $.showLoading("empty processing");
                                $.ajax({
                                    type: "POST",
                                    url: "{:url('goods/order')}",
                                    dataType: "json",
                                    data: {
                                        id: $(".buyid").val(),
                                        sum: $('.numInput').val(),
                                        buy_type: 2
                                    },
                                    success: function (data) {
                                        $.hideLoading();
                                        $.alert(data.msg + "<br/>" + data.msg1, function () {
                                            location.href = "{:url('index/index')}";
                                        });
                                    }
                                })
                            }
                        });
                    }
                }
            })
        })

        $(".issuebtn").click(function () {
            $(".issueForm").submit();
            $(".issueForm>input").val("");
            $(".issuebtn").attr("class","issuebtn_2");
        })
        //购买資產的弹出框
        $(".buy").click(function () {
//            $.modal({
//                title: "{$is_language?'買入':'Buy'}",
//                text: "{$is_language?'請確認是否買入?':'Please choose the way to buy'}",
//                buttons: [
//                    { text: "{$is_language?'全資購買':'Wholly-owned purchase'}", onClick: function(){ quanzi() } },
//                    { text: "{$is_language?'申請融資':'Apply for financing'}", onClick: function(){ window.location.href = "{:url('capital/main')}?id="+hidid; }},
//                    { text: "{$is_language?'取消':'cancel'}", className: "default"},
//                ]
//            });
            var hidid = $(this).parents(".weui-cell").find('.hiddenid').val();
            $(".buyid").val(hidid);

//            function quanzi() {
                $(".select-dlog").css('display', 'none');
                $(".buy-dlog").css('display', 'block');
                $.ajax({
                    type: "POST",
                    url: "{:url('ajax_data')}",
                    dataType: "json",
                    data: {
                        id: hidid
                    },
                    success: function (data) {
                        var shouxu = data.content.con.purchase_fee;
                        var danjia = data.content.goods.money;
                        var zong = parseInt(danjia * shouxu) + parseInt(danjia);
                        var c_s = danjia * shouxu;
                        var c_s = c_s.toFixed(2);
                        var zong = Number(c_s) + Number(danjia);
                        var zong = zong.toFixed(2);
                        $('#shouxu').html(c_s);
                        $('#zong').html(zong);
                        $('.numInput').bind('input propertychange', function () {
                            var shouxu = data.content.con.purchase_fee;
                            var danjia = data.content.goods.money;
                            var num = $('.numInput').val();
                            var yx = shouxu * danjia * num;
                            var yx = yx.toFixed(2);
                            var z_shouxu = parseInt(shouxu * danjia * num).toFixed(2);
                            var zong = Number(yx) + Number(danjia * num);
                            var z_zong = Number(zong).toFixed(2);
                            $('#shouxu').html(yx);
                            $('#zong').html(z_zong);
                        });
                        $(".buybtn").click(function (e) {
                            if ($('.numInput').val() < 1) {
                                e.preventDefault();
                                var yuyan = $("#yuyan").val();
                                if (yuyan == 1) {
                                    $.alert("輸入的數量不能小於1!");
                                } else {
                                    $.alert("The number of inputs should not be less than 1!");
                                }
//                            }else if($("input[name='buy_type']:checked").val()==undefined) {
//                                $.alert('請選擇買漲或做空！（Please choose to buy or make a blank）')
                            } else {
                                console.log($("input[name='buy_type']:checked").val())
                                var yuyan = $('#yuyan').val();
                                if (yuyan == 1) {
                                    $.confirm({
                                        title: '提示',
                                        text: '確定買入嗎？',
                                        onOK: function () {
                                            //点击确认
                                            $.showLoading("買入處理中");
                                            $.ajax({
                                                type: "POST",
                                                url: "{:url('goods/order')}",
                                                dataType: "json",
                                                data: {
                                                    id: $(".buyid").val(),
                                                    sum: $('.numInput').val(),
                                                    buy_type: 1
                                                },
                                                success: function (data) {
                                                    $.hideLoading();
                                                    $.alert(data.msg + "<br/>" + data.msg1, function () {
                                                        location.href = "{:url('index/index')}";
                                                    });
                                                }
                                            })
                                        }
                                    });
                                } else {
                                    $.confirm({
                                        title: 'Prompt',
                                        text: 'Are you sure of buying?',
                                        onOK: function () {
                                            //点击确认
                                            $.showLoading("Buy processing");
                                            $.ajax({
                                                type: "POST",
                                                url: "{:url('goods/order')}",
                                                dataType: "json",
                                                data: {
                                                    id: $(".buyid").val(),
                                                    sum: $('.numInput').val(),
                                                    buy_type: 1
                                                },
                                                success: function (data) {
                                                    $.hideLoading();
                                                    $.alert(data.msg + "<br/>" + data.msg1, function () {
                                                        location.href = "{:url('index/index')}";
                                                    });
                                                }
                                            })
                                        }
                                    });
                                }
                            }
                        })
                    }
                })
//            }


            $('.rongzi').click(function () {

            })
        });

        $('.buy-close').click(function () {
            $(".buy-dlog").css('display', 'none');
            $(".select-dlog").css('display', 'none');
            $('body').css({
                "overflow-x": "auto",
                "overflow-y": "auto"
            });
            //然后点击取消或者确定时再取消body上的绑定
            $("body").off("touchmove");
            $('.numInput').val(1);
        });

        //修改資產的弹出框
        $(".modify").click(function () {
            $(".propriarea").val("");
            var type = 1;
            var hidid = $(this).parents(".weui-cell").find('.hiddenid').val();
            $(".modifyid").val(hidid);
            $.ajax({
                type: "POST",
                url: "{:url('ajax_data')}",
                dataType: "json",
                data: {
                    id: hidid,
                    type: type
                },
                success: function (data) {
                    //$(".proname").val(data.content.name);
                    $(".propriarea").val(data.content.goods.section);
                    //$(".pronum").val(data.content.sum);
                    if (data.content.goods.status == "0") {

                        $(".yes").attr("checked", "checked");
                    } else {
                        $(".no").attr("checked", "checked");
                    }
                }
            })

            $(".modify-dlog").css('display', 'block');
            $('body').css({
                "overflow-x": "hidden",
                "overflow-y": "hidden"
            });
            //阻止默认
            $("body").on("touchmove", function (event) {
                event.preventDefault;
            }, false);
        });

        $('.modify-close').click(function () {
            $(".modify-dlog").css('display', 'none');
            $('body').css({
                "overflow-x": "auto",
                "overflow-y": "auto"
            });
            //然后点击取消或者确定时再取消body上的绑定
            $("body").off("touchmove");
        });
    })
</script>
</body>
</html>
